/**
 * Copyright (C)  2011-2011  Jesse Meng (pingf0@gmail.com).
 *
 * This file is part of OOC-GCC.
 *
 * OOC-GCC is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * OOC-GCC is distributed in the hope that it will be useful,but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with OOC-GCC. If not, see
 * <http://www.gnu.org/licenses/>.
 */

/*
 * OOBase2.h
 *
 *  Created on: 2011-11-16
 *      Author: Jesse Meng [pingf0@gmail.com]
 */

#ifndef OOBASE2_H_
#define OOBASE2_H_
#include "OOCfg.h"
#include "OOBase.h"

#define __OOC_FUNCTION__CLASS_PRIVATE_NEW(self,fn,param) \
	( { \
		if(__OOC_CLASS__LEVEL(self)==0){ \
			__OOC_CLASS__PRIVATE(self)=(void *)fn(param); \
		}\
		__OOC_CLASS__PRIVATE(self); \
	} )



#define __OOC_FUNCTION__CLASS_PRIVATE_DEL(self,fn,param) \
	( { \
		void **to_del=__OOC_CLASS__PRIVATE(self); \
		int ret_fn=0;\
		if(__OOC_CLASS__LEVEL(self)==0) { \
			ret_fn=fn(to_del,param); \
		} \
		ret_fn; \
	} )


//////////////////////////////////////////////////
#define __OOC_CLASS__TEMPLATE_DESIGN(Type) \
	__OOC_CLASS__RAW_DESIGN(_##Type)

#ifdef __OOC_USING__ANONYMOUS_EXTENSIONS
	#define __OOC_CLASS__TEMPLATE_EXTENDED_FROM(Type) \
		struct __##Type

	#define __OOC_CLASS__BIND_TEMPLATE(TypeA,TypeB) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeA) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeA) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeB) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeB) \
		struct _##TypeA {\
			__OOC_CLASS__ROOT_HEAD ; \
			struct __##TypeA ; \
			void ** TypeB##_static; \
		}; \
		struct _##TypeB {\
			__OOC_STATIC__ROOT_HEAD; \
			struct __##TypeB ; \
		};


	#define __OOC_CLASS__BIND_PREFIX(Prefix,TypeA,TypeB) \
		__OOC_CLASS__DECLARE_DEFINITIONS(Prefix##TypeA) \
		__OOC_CLASS__DECLARE_FUNCTIONS(Prefix##TypeA) \
		__OOC_CLASS__DECLARE_DEFINITIONS(Prefix##TypeB) \
		__OOC_CLASS__DECLARE_FUNCTIONS(Prefix##TypeB) \
		struct _Prefix##TypeA {\
			__OOC_CLASS__ROOT_HEAD ; \
			struct _Prefix##TypeA ; \
			void ** TypeB##_static; \
		}; \
		struct _Prefix##TypeB {\
			__OOC_STATIC__ROOT_HEAD; \
			struct _Prefix##TypeB ; \
		}


	#define __OOC_CLASS__BIND_SUFFIX(TypeA,TypeB,Suffix) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeA##Suffix) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeA##Suffix) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeB##Suffix) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeB##Suffix) \
		struct _##TypeA##Suffix {\
			__OOC_CLASS__ROOT_HEAD ; \
			struct _##TypeA ; \
			void ** TypeB##Suffix_static; \
		}; \
		struct _##TypeB##Suffix {\
			__OOC_STATIC__ROOT_HEAD; \
			struct _##TypeB##Suffix ; \
		}
#else
	#define __OOC_CLASS__TEMPLATE_EXTENDED_FROM(Type) \
		struct __##Type Type

	#define __OOC_CLASS__BIND_TEMPLATE(TypeA,TypeB) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeA) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeA) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeB) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeB) \
		struct _##TypeA {\
			__OOC_CLASS__ROOT_HEAD ; \
			struct __##TypeA TypeA ; \
			void ** TypeB##_static; \
		}; \
		struct _##TypeB {\
			__OOC_STATIC__ROOT_HEAD; \
			struct __##TypeB TypeB ; \
		};


	#define __OOC_CLASS__BIND_PREFIX(Prefix,TypeA,TypeB) \
		__OOC_CLASS__DECLARE_DEFINITIONS(Prefix##TypeA) \
		__OOC_CLASS__DECLARE_FUNCTIONS(Prefix##TypeA) \
		__OOC_CLASS__DECLARE_DEFINITIONS(Prefix##TypeB) \
		__OOC_CLASS__DECLARE_FUNCTIONS(Prefix##TypeB) \
		struct _Prefix##TypeA {\
			__OOC_CLASS__ROOT_HEAD ; \
			struct _Prefix##TypeA TypeA ; \
			void ** TypeB##_static; \
		}; \
		struct _Prefix##TypeB {\
			__OOC_STATIC__ROOT_HEAD; \
			struct _Prefix##TypeB TypeB ; \
		}


	#define __OOC_CLASS__BIND_SUFFIX(TypeA,TypeB,Suffix) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeA##Suffix) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeA##Suffix) \
		__OOC_CLASS__DECLARE_DEFINITIONS(TypeB##Suffix) \
		__OOC_CLASS__DECLARE_FUNCTIONS(TypeB##Suffix) \
		struct _##TypeA##Suffix {\
			__OOC_CLASS__ROOT_HEAD ; \
			struct _##TypeA TypeA ; \
			void ** TypeB##Suffix_static; \
		}; \
		struct _##TypeB##Suffix {\
			__OOC_STATIC__ROOT_HEAD; \
			struct _##TypeB##Suffix TypeB ; \
		}
#endif
////////////////////////////////////////////////
#define __OOC_CLASS__STATIC_DESIGN(Type) \
				__OOC_CLASS__STATIC_LINK(Type); \
			} __OOC_CLASS__ANONYMOUS_NAME;\
		}; \
		__OOC_CLASS__RAW_DESIGN(Type) {\
			__OOC_STATIC__ROOT_HEAD

#ifdef __OOC_USING__ANONYMOUS_EXTENSIONS
	#define __OOC_CLASS__STATIC_AND_EXTENDED_DESIGN(Type,SuType) \
				__OOC_CLASS__STATIC_LINK(Type); \
				} __OOC_CLASS__ANONYMOUS_NAME;\
			}; \
			__OOC_CLASS__RAW_DESIGN(Type) {\
				__OOC_STATIC__ROOT_HEAD; \
				struct _##SuType
#else
	#define __OOC_CLASS__STATIC_AND_EXTENDED_DESIGN(Type,SuType) \
				__OOC_CLASS__STATIC_LINK(Type); \
				} __OOC_CLASS__ANONYMOUS_NAME;\
			}; \
			__OOC_CLASS__RAW_DESIGN(Type) {\
				__OOC_STATIC__ROOT_HEAD; \
				struct _##SuType SuType
#endif
////////////////////////////////////////////////
 //ROOTED CTOR&DTOR CLASS BODY DESIGN
#define __OOC_CONSTRUCTOR__ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,__OOC_FUNCTION__RELOAD) \
	static struct _##Type_STATIC * Type_STATIC##_static=NULL; \
	iFn fn_reload=NULL; \
	__OOC_FUNCTION__PRINT_CLASS; \
	if(NULL==Type_STATIC##_static) { \
		Type_STATIC##_static=new##Type_STATIC(__OOC_PARAMETER); \
		if(NULL==Type_STATIC##_static) { \
			return (-1); \
		} \
	} \
	__OOC_THIS->Type_STATIC##_static=(void **)&(Type_STATIC##_static); \
	++__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static); \
	__OOC_CLASS__ASSIGN_CLASS_SIZE(Type); \
	fn_reload=(void *)__OOC_FUNCTION__RELOAD; \
	if(NULL!=fn_reload) { \
		return fn_reload(__OOC_THIS,__OOC_PARAMETER); \
	} \
	return (0)

#define __OOC_CONSTRUCTOR__EXTENDED_ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,SuType,__OOC_FUNCTION__RELOAD) \
    static struct _##Type_STATIC * Type_STATIC##_static=NULL; \
    iFn fn_reload=NULL; \
    int ret_iniSu=0; \
    __OOC_FUNCTION__PRINT_CLASS ; \
    if(NULL==Type_STATIC##_static) { \
        Type_STATIC##_static=new##Type_STATIC(__OOC_PARAMETER); \
        if(NULL==Type_STATIC##_static) { \
            return (-1); \
        } \
    } \
    __OOC_THIS->Type_STATIC##_static=(void **)&(Type_STATIC##_static); \
    ++__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static); \
    __OOC_FUNCTION__CLASS_LEVEL_PLUSPLUS(__OOC_THIS); \
    ret_iniSu=ini##SuType((SuType *)(__OOC_THIS),__OOC_PARAMETER); \
    if(0>ret_iniSu) { \
        return (ret_iniSu); \
    }  \
    __OOC_FUNCTION__CLASS_LEVEL_MINUSMINUS(__OOC_THIS); \
    __OOC_CLASS__ASSIGN_CLASS_SIZE(Type); \
    fn_reload=(void *)__OOC_FUNCTION__RELOAD; \
    if(NULL!=fn_reload) { \
		return fn_reload(__OOC_THIS,__OOC_PARAMETER); \
    } \
    return (0)

#define __OOC_DESTRUCTOR__ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,__OOC_FUNCTION__UNLOAD) \
    Type_STATIC * Type_STATIC##_static=(*(__OOC_THIS->Type_STATIC##_static)); \
	iFn fn_unload=NULL; \
	__OOC_FUNCTION__PRINT_CLASS ; \
	fn_unload=(void *)__OOC_FUNCTION__UNLOAD; \
    if(NULL!=fn_unload) { \
    	int ret_unload=fn_unload(__OOC_THIS,__OOC_PARAMETER); \
        if(0>ret_unload){ \
            return (ret_unload); \
        } \
    } \
	if(NULL==Type_STATIC##_static) { \
		return (-1); \
	}\
    if( 0<__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static) ) { \
    	--__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static); \
        if( 0==__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static) ) { \
        	int ret_delSt=0; \
        	*(__OOC_THIS->Type_STATIC##_static)=NULL; \
            ret_delSt=del##Type_STATIC(&Type_STATIC##_static,__OOC_PARAMETER); \
            if(0>ret_delSt) { \
                return (ret_delSt); \
            } \
        } \
    }\
    __OOC_FUNCTION__MEMORY_CLEAN(__OOC_CLASS__BODY(__OOC_THIS),sizeof(Type)-__OOC_CLASS__ROOT_HEAD_SIZE); \
    return (0)

#define __OOC_DESTRUCTOR__EXTENDED_ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,SuType,__OOC_FUNCTION__UNLOAD) \
    Type_STATIC * Type_STATIC##_static=(*(__OOC_THIS->Type_STATIC##_static)); \
	int ret_finSu=0; \
	iFn fn_unload=NULL; \
	__OOC_FUNCTION__PRINT_CLASS ; \
	fn_unload=(void *)__OOC_FUNCTION__UNLOAD; \
    if(NULL!=fn_unload) { \
    	int ret_unload=fn_unload(__OOC_THIS,__OOC_PARAMETER); \
        if(0>ret_unload){ \
            return (ret_unload); \
        } \
    } \
    __OOC_FUNCTION__CLASS_LEVEL_MINUSMINUS(__OOC_THIS); \
    ret_finSu=fin##SuType((SuType *)(__OOC_THIS),__OOC_PARAMETER); \
    if(0>ret_finSu) { \
        return (ret_finSu); \
    } \
    __OOC_FUNCTION__CLASS_LEVEL_PLUSPLUS(__OOC_THIS); \
    if(NULL==Type_STATIC##_static) { \
        return (-1); \
    }\
    if( 0<__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static) ) { \
        --__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static) ; \
        if( 0==__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static) ) { \
        	int ret_delSt=0; \
            *(__OOC_THIS->Type_STATIC##_static)=NULL; \
            ret_delSt=del##Type_STATIC(&Type_STATIC##_static,__OOC_PARAMETER); \
            if(0>ret_delSt) { \
                return (ret_delSt); \
            } \
        } \
    }\
    __OOC_FUNCTION__MEMORY_CLEAN(__OOC_CLASS__BODY(__OOC_THIS),sizeof(Type)-__OOC_CLASS__ROOT_HEAD_SIZE); \
    return (0)
//ROOTED CTOR&DTOR STATIC BODY DESIGN
#define __OOC_CONSTRUCTOR__ROOTED_STATIC_BODY_EX(Type,__OOC_FUNCTION__RELOAD_STATIC) \
	iFn fn_reloadSt=NULL;\
	__OOC_FUNCTION__PRINT_CLASS ; \
	__OOC_STATIC__ASSIGN_CLASS_DELETE(Type); \
	fn_reloadSt=(void *)__OOC_FUNCTION__RELOAD_STATIC; \
	if(NULL!=fn_reloadSt) { \
		return fn_reloadSt(__OOC_THIS,__OOC_PARAMETER); \
	} \
	return (0)

#define __OOC_CONSTRUCTOR__EXTENDED_ROOTED_STATIC_BODY_EX(Type,SuType_STATIC,__OOC_FUNCTION__RELOAD_STATIC) \
	iFn fn_reloadSt=NULL; \
	int ret_iniSu=0; \
	__OOC_FUNCTION__PRINT_CLASS ; \
    ret_iniSu=ini##SuType_STATIC((SuType_STATIC *)(__OOC_THIS),__OOC_PARAMETER); \
    if(0>ret_iniSu) { \
        return (ret_iniSu); \
    }  \
    __OOC_STATIC__ASSIGN_CLASS_DELETE(Type); \
    fn_reloadSt=(void *)__OOC_FUNCTION__RELOAD_STATIC; \
	if(NULL!=fn_reloadSt) { \
		return fn_reloadSt(__OOC_THIS,__OOC_PARAMETER); \
	} \
	return (0)

#define __OOC_DESTRUCTOR__ROOTED_STATIC_BODY_EX(Type_STATIC,__OOC_FUNCTION__UNLOAD_STATIC) \
	iFn fn_unloadSt=NULL; \
	__OOC_FUNCTION__PRINT_CLASS ; \
	fn_unloadSt=(void *)__OOC_FUNCTION__UNLOAD_STATIC; \
	if(NULL!=fn_unloadSt) { \
		int ret_unloadSt=fn_unloadSt(__OOC_THIS,__OOC_PARAMETER);\
		if(0>ret_unloadSt){ \
			return (ret_unloadSt); \
		} \
	} \
	__OOC_FUNCTION__MEMORY_CLEAN(__OOC_STATIC__BODY(__OOC_THIS),sizeof(Type_STATIC)-__OOC_STATIC__ROOT_HEAD_SIZE); \
	return (0)


#define __OOC_DESTRUCTOR__EXTENDED_ROOTED_STATIC_BODY_EX(Type_STATIC,SuType_STATIC,__OOC_FUNCTION__UNLOAD_STATIC) \
	iFn fn_unloadSt=NULL; \
	int ret_finSt=0; \
	__OOC_FUNCTION__PRINT_CLASS ; \
	fn_unloadSt=(void *)__OOC_FUNCTION__UNLOAD_STATIC; \
	if(NULL!=fn_unloadSt) { \
		int ret_unloadSt=fn_unloadSt(__OOC_THIS,__OOC_PARAMETER);\
		if(0>ret_unloadSt){ \
			return (ret_unloadSt); \
		} \
	} \
	ret_finSt=fin##SuType_STATIC((SuType_STATIC *)(__OOC_THIS),__OOC_PARAMETER); \
	if(0>ret_finSt){ \
		return (ret_finSt); \
	}  \
	__OOC_FUNCTION__MEMORY_CLEAN(__OOC_STATIC__BODY(__OOC_THIS),sizeof(Type_STATIC)-__OOC_STATIC__ROOT_HEAD_SIZE); \
	return (0)
///////////////////////////////////////////////////////////////////////////////////////////////
#define __OOC_ASSEMBLE__TEMPLATE(Type,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD) \
	__OOC_ASSEMBLE__C0(_##Type,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD)

#define __OOC_ASSEMBLE__EXTENDED_TEMPLATE(Type,SuType,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD) \
	__OOC_ASSEMBLE__C1(_##Type,_##SuType,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD)
///////////////////////////////////////////////////////////////////////////////////////////////
#define __OOC_ASSEMBLE__BIND_TEMPLATE(Type,Type_STATIC) \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type){ \
		static struct _##Type_STATIC * Type_STATIC##_static=NULL; \
		__OOC_FUNCTION__PRINT_CLASS; \
		if(NULL==Type_STATIC##_static) { \
			Type_STATIC##_static=new##Type_STATIC(__OOC_PARAMETER); \
			if(NULL==Type_STATIC##_static) { \
				return (-1); \
			} \
		} \
		__OOC_THIS->Type_STATIC##_static=(void **)&(Type_STATIC##_static); \
		++__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static); \
		__OOC_CLASS__ASSIGN_CLASS_SIZE(Type); \
		return ini_##Type((_##Type *)__OOC_CLASS__BODY(__OOC_THIS),__OOC_PARAMETER); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type){ \
		Type_STATIC * Type_STATIC##_static=(*(__OOC_THIS->Type_STATIC##_static)); \
		__OOC_FUNCTION__PRINT_CLASS ; \
		{\
			int ret_fin=fin_##Type((_##Type *)__OOC_CLASS__BODY(__OOC_THIS),__OOC_PARAMETER); \
			if(0>ret_fin){ \
				return (ret_fin); \
			} \
		} \
		if(NULL==Type_STATIC##_static) { \
			return (-1); \
		}\
		if( 0<__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static) ) { \
			--__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static); \
			if( 0==__OOC_STATIC__CLASS_COUNT(Type_STATIC##_static) ) { \
				int ret_delSt=0; \
				*(__OOC_THIS->Type_STATIC##_static)=NULL; \
				ret_delSt=del##Type_STATIC(&Type_STATIC##_static,__OOC_PARAMETER); \
				if(0>ret_delSt) { \
					return (ret_delSt); \
				} \
			} \
		}\
		__OOC_FUNCTION__MEMORY_CLEAN(__OOC_CLASS__BODY(__OOC_THIS),sizeof(Type)-__OOC_CLASS__ROOT_HEAD_SIZE); \
		return (0); \
	} \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_FUNCTION__PRINT_CLASS ; \
		__OOC_STATIC__ASSIGN_CLASS_DELETE(Type); \
		return ini_##Type_STATIC((_##Type_STATIC *)__OOC_STATIC__BODY(__OOC_THIS),__OOC_PARAMETER); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_FUNCTION__PRINT_CLASS ; \
		{ \
			int ret_finSt=fin_##Type_STATIC((_##Type_STATIC *)__OOC_STATIC__BODY(__OOC_THIS),__OOC_PARAMETER);\
			if(0>ret_finSt){ \
				return (ret_finSt); \
			} \
		} \
		__OOC_FUNCTION__MEMORY_CLEAN(__OOC_STATIC__BODY(__OOC_THIS),sizeof(Type_STATIC)-__OOC_STATIC__ROOT_HEAD_SIZE); \
		return (0); \
	}


#define __OOC_ASSEMBLE__C0S0(Type,Type_STATIC,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD,__OOC_FUNCTION__RELOAD_STATIC,__OOC_FUNCTION__UNLOAD_STATIC) \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_CONSTRUCTOR__ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,__OOC_FUNCTION__RELOAD); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_DESTRUCTOR__ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,__OOC_FUNCTION__UNLOAD); \
	} \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_CONSTRUCTOR__ROOTED_STATIC_BODY_EX(Type,__OOC_FUNCTION__RELOAD_STATIC); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_DESTRUCTOR__ROOTED_STATIC_BODY_EX(Type_STATIC,__OOC_FUNCTION__UNLOAD_STATIC); \
	}

#define __OOC_ASSEMBLE__C0S1(Type,Type_STATIC,SuType_STATIC,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD,__OOC_FUNCTION__RELOAD_STATIC,__OOC_FUNCTION__UNLOAD_STATIC) \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_CONSTRUCTOR__ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,__OOC_FUNCTION__RELOAD); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_DESTRUCTOR__ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,__OOC_FUNCTION__UNLOAD); \
	} \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_CONSTRUCTOR__EXTENDED_ROOTED_STATIC_BODY_EX(Type,SuType_STATIC,__OOC_FUNCTION__RELOAD_STATIC); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_DESTRUCTOR__EXTENDED_ROOTED_STATIC_BODY_EX(Type_STATIC,SuType_STATIC,__OOC_FUNCTION__UNLOAD_STATIC); \
	}

#define __OOC_ASSEMBLE__C1S0(Type,Type_STATIC,SuType,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD,__OOC_FUNCTION__RELOAD_STATIC,__OOC_FUNCTION__UNLOAD_STATIC) \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_CONSTRUCTOR__EXTENDED_ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,SuType,Type_STATIC,__OOC_FUNCTION__RELOAD); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_DESTRUCTOR__EXTENDED_ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,SuType,Type_STATIC,__OOC_FUNCTION__UNLOAD); \
	} \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_CONSTRUCTOR__ROOTED_STATIC_BODY_EX(Type,__OOC_FUNCTION__RELOAD_STATIC); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_DESTRUCTOR__ROOTED_STATIC_BODY_EX(Type_STATIC,__OOC_FUNCTION__UNLOAD_STATIC); \
	}

#define __OOC_ASSEMBLE__C1S1(Type,Type_STATIC,SuType,SuType_STATIC,__OOC_FUNCTION__RELOAD,__OOC_FUNCTION__UNLOAD,__OOC_FUNCTION__RELOAD_STATIC,__OOC_FUNCTION__UNLOAD_STATIC) \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_CONSTRUCTOR__EXTENDED_ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,SuType,__OOC_FUNCTION__RELOAD); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type){ \
		__OOC_DESTRUCTOR__EXTENDED_ROOTED_CLASS_BODY_WITH_STATIC_PART_EX(Type,Type_STATIC,SuType,__OOC_FUNCTION__UNLOAD); \
	} \
	__OOC_CONSTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_CONSTRUCTOR__EXTENDED_ROOTED_STATIC_BODY_EX(Type,SuType_STATIC,__OOC_FUNCTION__RELOAD_STATIC); \
	} \
	__OOC_DESTRUCTOR__CLASS_DESIGN(Type_STATIC){ \
		__OOC_DESTRUCTOR__EXTENDED_ROOTED_STATIC_BODY_EX(Type_STATIC,SuType_STATIC,__OOC_FUNCTION__UNLOAD_STATIC); \
	}


#endif /* OOBASE2_H_ */
